using System;
using System.Collections.Generic;
using Castle.ActiveRecord;
using CosyTrade.Data;

namespace CosyTrade.StoreManagement
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [Serializable, ActiveRecord("importBill")]
    public class ImportBill : ImportBillBase
    {
        private ExportBill maptoExportBill;

        private readonly IList<ImportBillItem> billItems = new List<ImportBillItem>();

        [BelongsTo("maptoExportBillGuid")]
        public ExportBill MaptoExportBill
        {
            get { return maptoExportBill; }
            set { maptoExportBill = value; }
        }

        [HasMany(typeof(ImportBillItem), "importBillGuid", "importBillItems", Access=PropertyAccess.NosetterCamelcase, Where="IsDeleteObject=0")]
        public IList<ImportBillItem> BillItems
        {
            get { return billItems; }
        }
    }
}